home *** CD-ROM | disk | FTP | other *** search
/ Resident 2 / Resident - Issue 2 (19xx)(Angelica - SHI).adf / Data / 038 < prev    next >
Text File  |  1993-04-19  |  8KB  |  231 lines

  1. ¶3  MOTOROLA 68000 - If the cap fits...
  2.                                        
  3. ¶2         By Dr Alan Clements
  4.       Typed and edited by Dotten
  5.      (God be in mercy of my soul)
  6.    (Automatic spell-checker: Cray)
  7.  
  8. ¶1  Since  the  PC has become a de facto
  9. standard,   why  should  anyone  worry
  10. about  other types of computer?  Well,
  11. I  do,  because  I  teach  courses  in
  12. computer architecture.  My courses are
  13. generally base on the 68000 family and
  14. each  year  at  least one student asks
  15. why I am not teaching the architecture
  16. of the 80386.  The short answer I give
  17. is   'Just   because   you  can't  see
  18. something doesn't mean that it doesn't
  19. exist.  The long answer is provided by
  20. this article.
  21.  
  22.   My  job is to TEACH students, not to
  23. train  them.   When  I  teach computer
  24. architecture  I present the underlying
  25. principles  and  expect my students to
  26. use  these principles to syntesize new
  27. knowledge  long  after they graduated.
  28. For  example,  in  ten years one of my
  29. students might have to make a decision
  30. about  which  microprocessor  (mp)  to
  31. embed  into an aircraft flight control
  32. system.   He  or she should be able to
  33. apply  the basic principles I teach in
  34. my courses.  Training, by contrast, is
  35. more  concerned with teaching directly
  36. applicable  knowledge that enables the
  37. student to perform a specific task:  a
  38. course  on  how  to  use  Word Perfect
  39. would be considered as training.  If I
  40. were  training  my  students  to be PC
  41. salespeople   or  engineers,  I  would
  42. certanly use the 8086 family.
  43.  
  44.   I  select  the ¶368000 ¶1as a vehicle to
  45. teach computer architecture because it
  46. is  much  better  suited  to this task
  47. than  members  of  the  Intel  family.
  48. Choosing  the  Motorola  family rather
  49. than   the   Intel  family  is  not  a
  50. criticism of Intel's chips.  (The jerk
  51. uses  a  PC.  Dotten's anm.) Intel was
  52. responisble  for  the mp as we know it
  53. and  wisely  (from a business point of
  54. view)   capitalized   on   its   lead.
  55. Although  it's  a simplification, each
  56. new   Intel   chip  is  built  on  the
  57. foundation    of   it's   predecessor.
  58. Intel's  first  16-bit chip, the 8086,
  59. was  essensially  an  extension of the
  60. 8-bit  8088.  This approach makes good
  61. economic sense because programmers can
  62. run  their  existing  software on each
  63. new  generation  of  Intel  chips with
  64. relatively little modification.
  65.  
  66. ¶2  Intel's competitor, Motorola, took a
  67. different  approach  to  chip  design.
  68. When  it  made  the jump from an 8-bit
  69. processor   (the  6800)  to  a  16-bit
  70. processor (the 68000), it went back to
  71. the drawing board.  Unlike Intel, it's
  72. new processor was in no way compatible
  73. with  its  old one and 8-bit users had
  74. to start again.  However by going back
  75. to  the  drawing  board,  Motorola was
  76. able   to   produce   a   true  32-bit
  77. processor  with  consistent  features.
  78. (Note  that  the  ¶368000 ¶2was originally
  79. called  a  16-bit processor because it
  80. communicates  via  a  16-bit data bus.
  81. As  far as the programmer is concerned
  82. the  68000  has  a 32-bit architecture
  83. because   it  registers  are  32  bits
  84. wide.)   (Like  the  80386SX  Dotten's
  85. anm.)
  86.  
  87. ¶1  Before  we  look  at  what the ¶368000
  88. ¶1family  has  to  offer the teacher, we
  89. need  to  point  out that it is not an
  90. obscure  teaching  tool relegated only
  91. to the classroom.  The ¶368000 ¶1family is
  92. used in far more applications than the
  93. 8086  family.  But most of the ¶368000¶1's
  94. applications   are  invisible  because
  95. they  are  largely used in industry or
  96. in dedicated applications (such as the
  97. laser  printer).  As I have said, just
  98. beacuse    you    cannot   see   these
  99. applications  it  does  not  mean they
  100. don't exist.
  101.  
  102. Simplicity
  103.  
  104. ¶2  Let's return to my job as a teacher.
  105. In a first year course I have to teach
  106. the basic principles of the CPU.  What
  107. I  need  is  a  simple  architecture -
  108. there's  no  point  in  obscuring  the
  109. fundamental  principles with a mass of
  110. detail.      The     ¶368000    ¶2embodies
  111. simplicity.    When  mp's  were  first
  112. introduced,  each  new  chip  had more
  113. instructions  and adressing modes than
  114. it's  predecessors.  Salespeople loved
  115. to  emphasize  this point:"Buy my chip
  116. because  it's  got  more  instructions
  117. than   brand  X".   It's  rather  like
  118. saying "learn German instead of French
  119. because  it's nouns have three genders
  120. rather than two".
  121.  
  122. ¶1  When  the  ¶368000 ¶1was first designed,
  123. it's   instruction  set  was  actually
  124. simpler  than  that of many 8-bit mp's
  125. even   though   it   was  vastly  more
  126. powerful.     This    simplicity   was
  127. achieved  in two ways.  Firstly unlike
  128. the  8086  the  ¶368000  ¶1does  not  have
  129. dedicated  registers.   The  68000 has
  130. eight  data  registers,  D0 to D7, and
  131. whatever  you  can do to Di you can do
  132. to Dj.  So, if I tell my students that
  133. ADD xyz,D2 is a legal instruction that
  134. adds  the  contents of xyz to register
  135. D2, they immediatly know that they can
  136. use  SUB  xyz,D6  to subtract xyz from
  137. D6.   Why?  Because specific registers
  138. are    not   dedicated   to   specific
  139. instructions  and  whatever you can do
  140. with D2 you can do with D6.  Secondly,
  141. the    ¶368000    ¶1has   simplified   its
  142. instruction  set by giving one name to
  143. all   the  members  of  the  class  of
  144. instructions  that  transfer data from
  145. on  place  to  another.   Prior to the
  146. 68000,  the  programmer  had  to learn
  147. instructions like:
  148.  
  149. LDA  Load  accumulator  with data from
  150. memory.  STA Store acc in memory.  LDX
  151. Load  index  register  with  data from
  152. memory.  STX Store index in memory.
  153.  
  154. (which  reminds  me of the fun'n'games
  155. we  had  with  the 6502 Dotten's anm.)
  156. [Fun??  I must say I prefer the 68000.
  157. Cray's anm.]
  158.  
  159. and  so  on.   The  ¶368000 ¶1has a simple
  160. MOVE  instruction  that transfers data
  161. from anywhere to anywhere.  MOVE D0,D2
  162. copies register D0 to D2.  MOVE A4,xyz
  163. copies  the contents of A4 into memory
  164. location xyz.  MOVE abc,def copies the
  165. contents  of  memory loaction abc into
  166. location  def.  What could be simpler?
  167. (Basic????   Dotten's  anm.)  [No!  In
  168. basic  you  would  have  to  use "Poke
  169. def,Peek(abc)"  Cray's  anm.] Having a
  170. powerful  but simple  instruction  set
  171. means I can do what I'm paid to do and
  172. not waste time teaching an instruction
  173. set that is as tedoius as the thirteen
  174. times  table.   (?????  Dotten's anm.)
  175. [Are you stupid?  It means 13x0, 13x1,
  176. 13x2 etc.  Cray's anm.]
  177.  
  178. ¶2  As    the   course   progresses   we
  179. introduce more advanced topics such as
  180. position  independent code.  A program
  181. may  not  always be located within the
  182. same  region  of  memory.  Suppose you
  183. write  a  device  driver  to control a
  184. video   display.    If   this  program
  185. accesses  specific memory loactions it
  186. must  always  be  stored  in  the same
  187. place  in every system using it.  This
  188. restriction     can    sometimes    be
  189. inconvenient, as another program might
  190. already  occupy  the  same  region  of
  191. memory space.  The ¶368000 ¶2allows you to
  192. write  programs in such a fashion that
  193. the   resulting  binary  code  can  be
  194. located  anywhere  in  memory  without
  195. having to be rewritten.
  196.  
  197. ¶1  The trick is to avoid explicit (i.e.
  198. actual)    memory    addresses.    For
  199. example,  the  ¶368000  ¶1instruction  ADD
  200. xyz(PC),D2  tells the processor to add
  201. the  contents  of  the memory location
  202. that  is  xyz  bytes  from the current  
  203. instruction   to   register   D2.   It
  204. doesn't  matter  where  you  put  this
  205. instruction  in  memory,  because  the
  206. data is always loacted xyz bytes away.
  207. The   notation   xyz(PC)   is   called
  208. relative    addressing   because   the
  209. loaction of the data is expressed with
  210. respect to the program counter.
  211.  
  212. ¶2  Students  studying  computer science
  213. also   take   courses  in  high  level
  214. languages   and   in  the  design  and
  215. construction  of  compilers  for these
  216. languages.   Two of the most important
  217. aspects  of  high  level languages are
  218. the way of which parameters are passed
  219. between  a  subroutine and the program
  220. that  calls  it,  and  recursion  (the
  221. ability  of  a  subroutine to call it-
  222. self).   The  ¶368000 ¶2implements, at the
  223. machine     code    level,    powerful
  224. mechanisms  that  performs  both these
  225. operations  efficiently.   For example
  226. the  ¶368000  ¶2has  a special instruction
  227. called  LINK that enables a subroutine
  228. to  grab  a  bit of memory for its own
  229. private  use.   Even  if  an interrupt
  230. occurs  and  other  software calls the
  231.